package com.humanmonth.util.effect
{
	import flash.display.DisplayObject;
	
	import mx.core.UIComponent;
	import mx.effects.Zoom;
	
	/**
	 * 鼠标经过时，放大和缩小
	 * @author 林子龙
	 * 
	 */
	public class PassbyEffectScale
	{
		private var big:Number=1.1;
		private var small:Number=1;
		private var duration:int=300;
		private var smallZoom:Zoom;
		private var bigZoom:Zoom;
		private var obj:DisplayObject;
		public function PassbyEffectScale()
		{
			smallZoom=new Zoom();
			smallZoom.zoomHeightFrom=big;
			smallZoom.zoomHeightTo=small;
			smallZoom.zoomWidthFrom=big;
			smallZoom.zoomWidthTo=small;
			smallZoom.duration=duration;
			bigZoom=new Zoom();
			bigZoom.zoomHeightFrom=small;
			bigZoom.zoomHeightTo=big;
			bigZoom.zoomWidthFrom=small;
			bigZoom.zoomWidthTo=big;
			bigZoom.duration=duration;
		}
		
		public function applyEffect(obj:UIComponent):void{
			obj.setStyle("rollOverEffect",bigZoom);
			obj.setStyle("rollOutEffect",smallZoom);
		}
		
		
	}
}